import React from 'react'

export default function UseRefFun() {
    const [string, setString] = React.useState("")
    const myRef = React.useRef()
    function inputText(params) {
        setString(string => myRef.current.value)
    }
    return (
        <div>
            <button className='returnButton'><a href="/">点击返回主菜单</a></button>
            <h1>useRefFun</h1>
            <input type="text" ref={myRef} onChange={inputText} />
            <p>输入的内容为:{string}</p>
        </div>
    )
}
